* ==============================================================================
* ==============================================================================
* IMF Book: IMFBOOK_Ch4_Code.do
*			Chapter 4: Conditionality and health policy
* ==============================================================================
use "IMFBOOK_Dataset.dta", clear
* ==============================================================================
* Generate variables
* ==============================================================================
encode ccode, gen(cid)
xtset cid year
gen ssa = subregion_UN=="Sub-Saharan Africa"
gen wafr = ccode=="BEN" | ccode=="BFA" | ccode=="CIV" | ccode=="CPV" | ccode=="GHA" | ccode=="GIN" | ccode=="GMB" | ccode=="GNB" | ccode=="LBR" | ccode=="MLI" | ccode=="MRT" | ccode=="NER" | ccode=="NGA" | ccode=="SEN" | ccode=="SLE" | ccode=="TGO"
* DVs
gen hgdp = 100*ghes_per_gdp_mean_IHME
rename ghes_per_cap_mean_IHME hpop
gen hlnrpop = ln(hpop)
* Controls
rename sp_urb_totl_in_zs_WDI urban
rename sp_pop_dpnd_WDI dratio
rename fh_ipolity2_QOG fhip
rename ne_trd_gnfs_zs_WDI trade
rename ggr_ngdp_WEO govrev
rename ggx_ngdp_WEO govexp
gen govbal = govrev - govexp
rename war_UCDP war
rename dt_oda_odat_gn_zs_WDI oda
rename ny_gdp_pcap_kd_WDI gdppc
gen lngdppc = ln(gdppc)
* IMF selection
rename bca_ngdpd_WEO cab
gen IMFliq = ln(IMFliquidity)
* EVs
egen IMFunder = sum(IMF55), by(year)
* propensity for country to recieve conditions
egen varBA2TOT=mean(BA2TOT) if year>=1980 & year<=2017, by(cid)
gen intBA2TOT=varBA2TOT*IMFliq
gen SCsBA2 = SPCsTOT + PAsTOT
gen QCsBA2 = QPCsTOT
egen varSCsBA2=mean(SCsBA2) if year>=1980 & year<=2017, by(cid)
gen intSCsBA2=varSCsBA2*IMFliq
egen varQCsBA2=mean(QCsBA2) if year>=1980 & year<=2017, by(cid)
gen intQCsBA2=varQCsBA2*IMFliq
gen BA2RFP = BA2FP + BA2RTP
gen BA2ENT = BA2SOE + BA2PRI
gen BA2GOV = BA2ENV + BA2INS + BA2OTH + BA2SP
foreach cond in BA2DEB BA2ENV BA2EXT BA2FIN BA2FP BA2INS BA2LAB BA2OTH BA2POV BA2PRI BA2RTP BA2SOE BA2SP BA2RFP BA2ENT BA2GOV {
	egen var`cond'=mean(`cond') if year>=1980 & year<=2017, by(cid)
	gen int`cond'=var`cond'*IMFliq
	gen res`cond' = BA2TOT - `cond'
	egen varres`cond'=mean(res`cond') if year>=1980 & year<=2017, by(cid)
	gen intres`cond'=varres`cond'*IMFliq
}
* propensity for country to participate
egen varIMF55=mean(IMF55) if year>=1980 & year<=2017, by(cid)
gen intIMF55=varIMF55*IMFliq
xtset cid year
foreach var in lngdppc urban dratio fhip war govbal trade oda cab IMFliq IMF55 BA2TOT SCsBA2 QCsBA2 BA2DEB BA2EXT BA2FIN BA2RFP BA2ENT BA2LAB BA2POV BA2GOV {
	gen L`var' = l.`var'
}
* ==============================================================================
* Factual statements
* ==============================================================================
* "In total, the sample includes government health spending statistics as a share of GDP and on a per capita basis for 4,485 country-years across 195 countries, for 23 years per country."
xtsum hgdp hpop if year>=1995 & year<=2017
* "The mean number of binding conditions, at 24.467 per year, thus corresponds to a reduction of 0.954 percentage points."
tabstat LBA2TOT if year>=1995 & year<=2017 & LIMF55==1, s(n mean sd mi ma) col(s)
* ==============================================================================
* Table 4.2. Descriptive statistics for health expenditure measures, 1995-2017
* ==============================================================================
tabstat hgdp hpop if year>=1995 & year<=2017, s(n mean sd mi ma) col(s)
* ==============================================================================
* Table 4.3. Descriptive statistics and sources for control variables, 1995-2017
* ==============================================================================
tabstat Llngdppc Lurban Ldratio Lfhip Lwar Lgovbal Ltrade Loda if year>=1995 & year<=2017, s(mean sd n) col(s)
* ==============================================================================
* Table 4.4 Effect of IMF conditionality on government health spending (% of GDP), 1995-2017
* ==============================================================================
xtset cid year
cmp setup
local ctrl "l.lngdppc l.urban l.dratio l.fhip l.war l.govbal l.trade l.oda i.cid ib2000.year"
local sele "\`ctrl' l.cab"
* controls only
eststo: reg hgdp `ctrl' if year>=1995 & year<=2017
* binding conditions
eststo: cmp (hgdp = LIMF55 l.BA2TOT `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2TOT = l.intBA2TOT `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* quantitative vs structural conditions
eststo: cmp (hgdp = LIMF55 l.SCsBA2 l.QCsBA2 `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.SCsBA2 = l.intSCsBA2 `sele') (res: l.QCsBA2 = l.intQCsBA2 `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
esttab, b(4) se(4) nogaps brackets star(+ 0.10 * 0.05 ** 0.01 *** 0.001) scalars(N_clust) sfmt(a4) drop(*cid *year)
estimates dir
estimates restore est2
test ([cond] l.intBA2TOT)
test ([LIMF55] l.intIMF55)
estimates restore est3
test ([cond] l.intSCsBA2)
test ([res] l.intQCsBA2)
test ([LIMF55] l.intIMF55)
eststo clear
* ==============================================================================
* Table 4.5. Effect of IMF conditionality on government health spending per capita, 1995-2017
* ==============================================================================
xtset cid year
cmp setup
local ctrl "l.lngdppc l.urban l.dratio l.fhip l.war l.govbal l.trade l.oda i.cid ib2000.year"
local sele "\`ctrl' l.cab"
* controls only
eststo: reg hlnrpop `ctrl' if year>=1995 & year<=2017
* binding conditions
eststo: cmp (hlnrpop = LIMF55 l.BA2TOT `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2TOT = l.intBA2TOT `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* quantitative vs structural conditions
eststo: cmp (hlnrpop = LIMF55 l.SCsBA2 l.QCsBA2 `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.SCsBA2 = l.intSCsBA2 `sele') (res: l.QCsBA2 = l.intQCsBA2 `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
esttab, b(4) se(4) nogaps brackets star(+ 0.10 * 0.05 ** 0.01 *** 0.001) scalars(N_clust) sfmt(a4) drop(*cid *year)
estimates dir
estimates restore est2
test ([cond] l.intBA2TOT)
test ([LIMF55] l.intIMF55)
estimates restore est3
test ([cond] l.intSCsBA2)
test ([res] l.intQCsBA2)
test ([LIMF55] l.intIMF55)
eststo clear
* =============================================================================
* Table 4.6. Key health indicators in West Africa
* =============================================================================
rename undp_hdi_QOG hdi
rename sp_dyn_imrt_in_WDI infant
gen conditionyear = 1 if BA1TOT>0 & !missing(BA1TOT)
egen yearsimf = total(conditionyear) if year>=1995 & year<=2017, by(cname)
egen hdirank = rank(hdi), by(year) field
egen hdirank_wafr = mean(hdirank) if wafr, by(year)
egen hdirank_ssa = mean(hdirank) if ssa, by(year)
egen hdirank_lic = mean(hdirank) if lic, by(year)
egen yearsimf_wafr = mean(yearsimf) if wafr, by(year)
egen yearsimf_ssa = mean(yearsimf) if ssa, by(year)
egen yearsimf_lic = mean(yearsimf) if lic, by(year)
egen hgdp_wafr = mean(hgdp) if wafr, by(year)
egen hgdp_ssa = mean(hgdp) if ssa, by(year)
egen hgdp_lic = mean(hgdp) if lic, by(year)
egen hpop_wafr = mean(hpop) if wafr, by(year)
egen hpop_ssa = mean(hpop) if ssa, by(year)
egen hpop_lic = mean(hpop) if lic, by(year)
egen infant_wafr = mean(infant) if wafr, by(year)
egen infant_ssa = mean(infant) if ssa, by(year)
egen infant_lic = mean(infant) if lic, by(year)
sort cname year
clist cname year hdirank hgdp hpop infant yearsimf if year==1995 & wafr, noob
clist cname year hdirank hgdp hpop infant yearsimf if year==2017 & wafr, noob
tabstat hdirank_wafr hdirank_ssa hdirank_lic if year==2017 & wafr, s(mean) col(s)
tabstat yearsimf_wafr yearsimf_ssa yearsimf_lic if year==2017 & wafr, s(mean) col(s)
tabstat hgdp_wafr hgdp_ssa hgdp_lic if (year==1995 | year==2017) & wafr, s(mean) by(year) col(s)
tabstat hpop_wafr hpop_ssa hpop_lic if (year==1995 | year==2017) & wafr, s(mean) by(year) col(s)
tabstat infant_wafr infant_ssa infant_lic if (year==1995 | year==2017) & wafr, s(mean) by(year) col(s)
* ==============================================================================
* Figure 4.1. Government health spending (% of GDP), 1995 and 2017
* ==============================================================================
preserve
*** get the shapefiles in order
capture cd "GIS"
spshape2dta "World_Countries__Generalized_.shp", replace saving(world)
*** explore the outline file
use world_shp, clear
geo2xy _Y _X, proj (web_mercator) replace
*** merge with attributes file to get the names
merge m:1 _ID using world
drop if COUNTRY=="Antarctica"
drop rec_header- _merge
sort _ID
save, replace
*** merging
use world, clear
ren COUNTRY cname             
drop if cname=="Antarctica"
replace cname="Bahamas, The" if cname=="Bahamas"
replace cname="Congo, Dem. Rep." if cname=="Congo DRC"
replace cname="Congo, Rep." if cname=="Congo"
replace cname="Cote d'Ivoire" if cname=="Côte d'Ivoire"
replace cname="Egypt, Arab Rep." if cname=="Egypt"
replace cname="Gambia, The" if cname=="Gambia"
replace cname="Iran, Islamic Rep." if cname=="Iran"
replace cname="Korea, Dem. People's Rep." if cname=="North Korea"
replace cname="Korea, Rep." if cname=="South Korea"
replace cname="Kyrgyz Republic" if cname=="Kyrgyzstan"
replace cname="Lao PDR" if cname=="Laos"
replace cname="Micronesia, Fed. Sts." if cname=="Micronesia"
replace cname="Sint Maarten (Dutch part)" if cname=="Sint Maarten"
replace cname="Slovak Republic" if cname=="Slovakia"
replace cname="St. Kitts and Nevis" if cname=="Saint Kitts and Nevis"
replace cname="St. Lucia" if cname=="Saint Lucia"
replace cname="St. Martin (French part)" if cname=="Saint Martin"
replace cname="St. Vincent and the Grenadines" if cname=="Saint Vincent and the Grenadines"
replace cname="Syrian Arab Republic" if cname=="Syria"
replace cname="Venezuela, RB" if cname=="Venezuela"
replace cname="Virgin Islands (U.S.)" if cname=="US Virgin Islands"
replace cname="West Bank and Gaza" if cname=="Palestinian Territory"
replace cname="Yemen, Rep." if cname=="Yemen"
merge 1:m cname using "..\IMFBOOK_Dataset.dta"
*** see which countries didn't merge
tab cname if _m==1
tab cname if _m==2 
*** generate a local for the color scheme
colorpalette spmap greys, n(4) nograph
local colors `r(p)'
gen hgdp = 100*ghes_per_gdp_mean_IHME
spmap hgdp using world_shp if year==1995, id(_ID) ocolor(black ..) osize(vvthin ..) fcolor("`colors'") legend(pos(7) size(*1)) legtitle("Government health spending" "(% of GDP) 1995") legstyle(2) ndfcolor(white ..) ndlabel("Missing") ndsize(vvthin ..) clmethod(custom) clbreaks(0 2 4 6 14)
graph export "..\Figures\IMFBOOK_Figure4-1a.png", replace width(4000)
spmap hgdp using world_shp if year==2017, id(_ID) ocolor(black ..) osize(vvthin ..) fcolor("`colors'") legend(pos(7) size(*1)) legtitle("Government health spending" "(% of GDP) 2017") legstyle(2) ndfcolor(white ..) ndlabel("Missing") ndsize(vvthin ..) clmethod(custom) clbreaks(0 2 4 6 14)
graph export "..\Figures\IMFBOOK_Figure4-1b.png", replace width(4000)
capture cd ..
restore
* ==============================================================================
* Figure 4.2. Government health spending per capita, 1995 and 2017
* ==============================================================================
preserve
*** get the shapefiles in order
capture cd "GIS"
spshape2dta "World_Countries__Generalized_.shp", replace saving(world)
*** explore the outline file
use world_shp, clear
geo2xy _Y _X, proj (web_mercator) replace
*** merge with attributes file to get the names
merge m:1 _ID using world
drop if COUNTRY=="Antarctica"
drop rec_header- _merge
sort _ID
save, replace
*** merging
use world, clear
ren COUNTRY cname             
drop if cname=="Antarctica"
replace cname="Bahamas, The" if cname=="Bahamas"
replace cname="Congo, Dem. Rep." if cname=="Congo DRC"
replace cname="Congo, Rep." if cname=="Congo"
replace cname="Cote d'Ivoire" if cname=="Côte d'Ivoire"
replace cname="Egypt, Arab Rep." if cname=="Egypt"
replace cname="Gambia, The" if cname=="Gambia"
replace cname="Iran, Islamic Rep." if cname=="Iran"
replace cname="Korea, Dem. People's Rep." if cname=="North Korea"
replace cname="Korea, Rep." if cname=="South Korea"
replace cname="Kyrgyz Republic" if cname=="Kyrgyzstan"
replace cname="Lao PDR" if cname=="Laos"
replace cname="Micronesia, Fed. Sts." if cname=="Micronesia"
replace cname="Sint Maarten (Dutch part)" if cname=="Sint Maarten"
replace cname="Slovak Republic" if cname=="Slovakia"
replace cname="St. Kitts and Nevis" if cname=="Saint Kitts and Nevis"
replace cname="St. Lucia" if cname=="Saint Lucia"
replace cname="St. Martin (French part)" if cname=="Saint Martin"
replace cname="St. Vincent and the Grenadines" if cname=="Saint Vincent and the Grenadines"
replace cname="Syrian Arab Republic" if cname=="Syria"
replace cname="Venezuela, RB" if cname=="Venezuela"
replace cname="Virgin Islands (U.S.)" if cname=="US Virgin Islands"
replace cname="West Bank and Gaza" if cname=="Palestinian Territory"
replace cname="Yemen, Rep." if cname=="Yemen"
merge 1:m cname using "..\IMFBOOK_Dataset.dta"
*** see which countries didn't merge
tab cname if _m==1
tab cname if _m==2 
*** generate a local for the color scheme
colorpalette spmap greys, n(4) nograph
local colors `r(p)'
rename ghes_per_cap_mean_IHME hpop
spmap hpop using world_shp if year==1995, id(_ID) ocolor(black ..) osize(vvthin ..) fcolor("`colors'") legend(pos(7) size(*1)) legtitle("Government health spending" "per capita 1995") legstyle(2) ndfcolor(white ..) ndlabel("Missing") ndsize(vvthin ..) clmethod(custom) clbreaks(0 150 300 450 7000)
graph export "..\Figures\IMFBOOK_Figure4-2a.png", replace width(4000)
spmap hpop using world_shp if year==2017, id(_ID) ocolor(black ..) osize(vvthin ..) fcolor("`colors'") legend(pos(7) size(*1)) legtitle("Government health spending" "per capita 2017") legstyle(2) ndfcolor(white ..) ndlabel("Missing") ndsize(vvthin ..) clmethod(custom) clbreaks(0 150 300 450 7000)
graph export "..\Figures\IMFBOOK_Figure4-2b.png", replace width(4000)
capture cd ..
restore
* ==============================================================================
* Figure 4.3. Government health spending (% of GDP), 1995-2017
* ==============================================================================
preserve
egen expBA=mean(BA2TOT) if year>=1995 & year<=2017, by(cid)
sum expBA if year>=1995 & year<=2017, d
gen highBA=(expBA>`r(p50)') if year>=1995 & year<=2017
egen meanhgdp = mean(hgdp) if year>=1995 & year<=2017, by(year)
egen highBAmean = mean(hgdp) if year>=1995 & year<=2017 & highBA==1, by(year)
egen lowBAmean = mean(hgdp) if year>=1995 & year<=2017 & highBA==0, by(year)
twoway (scatter meanhgdp year if year>=1995 & year<=2017, sort(year) connect(l) msymbol(i) lp(solid) lw(thick)) (scatter highBAmean year if year>=1995 & year<=2017, sort(year) connect(l) msymbol(i) lp(dash) lw(thick)) (scatter lowBAmean year if year>=1995 & year<=2017, sort(year) connect(l) msymbol(i) lp(shortdash_dot) lw(thick)), graphregion(color(white)) legend(rows(3) label(1 "Mean of all countries") label(2 "Above-mean conditionality countries") label(3 "Below-mean conditionality countries")) ytitle(Government health spending (% of GDP)) ylabel(2(.5)4.5, angle(horizontal)) xlabel(1995(5)2020) scheme(s2mono)
graph export "Figures\IMFBOOK_Figure4-3.png", replace width(4000)
restore
* ==============================================================================
* Figure 4.4 Government health spending per capita, 1995-2017
* ==============================================================================
preserve
egen expBA=mean(BA2TOT) if year>=1995 & year<=2017, by(cid)
sum expBA if year>=1995 & year<=2017, d
gen highBA=(expBA>`r(p50)') if year>=1995 & year<=2017
egen meanhpop = mean(hpop) if year>=1995 & year<=2017, by(year)
egen highBAmean = mean(hpop) if year>=1995 & year<=2017 & highBA==1, by(year)
egen lowBAmean = mean(hpop) if year>=1995 & year<=2017 & highBA==0, by(year)
twoway (scatter meanhpop year if year>=1995 & year<=2017, sort(year) connect(l) msymbol(i) lp(solid) lw(thick)) (scatter highBAmean year if year>=1995 & year<=2017, sort(year) connect(l) msymbol(i) lp(dash) lw(thick)) (scatter lowBAmean year if year>=1995 & year<=2017, sort(year) connect(l) msymbol(i) lp(shortdash_dot) lw(thick)), graphregion(color(white)) legend(rows(3) label(1 "Mean of all countries") label(2 "Above-mean conditionality countries") label(3 "Below-mean conditionality countries")) ytitle("Government health spending per capita" "(2019 USD)") ylabel(0(250)1500, angle(horizontal)) xlabel(1995(5)2020) scheme(s2mono)
graph export "Figures\IMFBOOK_Figure4-4.png", replace width(4000)
restore
* ==============================================================================
* Figure 4.5. Association between average annual government health spending (% of gdp) and total number of binding conditions, 1995-2017
* ==============================================================================
preserve
egen totalBA2TOT = total(BA2TOT) if year>=1995 & year<=2017, by(cid)
egen meanhgdp = mean(hgdp) if year>=1995 & year<=2017, by(cid)
corr totalBA2TOT meanhgdp if year>=1995 & year<=2017
local r: display %5.2f r(rho)
twoway (scatter meanhgdp totalBA2TOT if year>=1995 & year<=2017, msymbol(i) mlab(ccode) mlabpos(0)) (lfit meanhgdp totalBA2TOT if year>=1995 & year<=2017), legend(off) ytitle("Government health spending (% of GDP)") xtitle("Total number of conditions") ylabel(, angle(0)) note(r = `r', size(medsmall) placement(se)) graphregion(color(white)) scheme(s2mono)
graph export "Figures\IMFBOOK_Figure4-5.png", replace width(4000)
restore
* ==============================================================================
* Figure 4.6. Association between average annual government health spending per capita (logged) and total number of binding conditions, 1995-2017
* ==============================================================================
preserve
egen totalBA2TOT = total(BA2TOT) if year>=1995 & year<=2017, by(cid)
egen meanhlnrpop = mean(hlnrpop) if year>=1995 & year<=2017, by(cid)
corr totalBA2TOT meanhlnrpop if year>=1995 & year<=2017
local r: display %5.2f r(rho)
twoway (scatter meanhlnrpop totalBA2TOT if year>=1995 & year<=2017, msymbol(i) mlab(ccode) mlabpos(0)) (lfit meanhlnrpop totalBA2TOT if year>=1995 & year<=2017), legend(off) ytitle("Government health spending per capita (logged)") xtitle("Total number of conditions") ylabel(, angle(0)) note(r = `r', size(medsmall) placement(se)) graphregion(color(white)) scheme(s2mono)
graph export "Figures\IMFBOOK_Figure4-6.png", replace width(4000)
restore
* ==============================================================================
* Figure 4.7. Effect of IMF conditionality on government health spending (% of GDP), with 95% and 90% confidence intervals
* ==============================================================================
xtset cid year
cmp setup
local ctrl "l.lngdppc l.urban l.dratio l.fhip l.war l.govbal l.trade l.oda i.cid ib2000.year"
local sele "\`ctrl' l.cab"
cmp (hgdp = LIMF55 l.BA2TOT `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2TOT = l.intBA2TOT `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
margins, at(l.BA2TOT=(0 10 20 30 40 50) LIMF55=1) vsquish level(95) saving(l95, replace)
margins, at(l.BA2TOT=(0 10 20 30 40 50) LIMF55=1) vsquish level(90) saving(l90, replace)
combomarginsplot l95 l90, recast(line) recastci(rarea) ytitle(Linear prediction: Gov. health spending (% of GDP)) ylabel(, angle(horizontal)) xtitle(Number of binding conditions) title("") graphregion(color(white)) scheme(s2mono) legend(off)
graph export "Figures\IMFBOOK_Figure4-7.png", replace width(4000)
erase l95.dta
erase l90.dta
* ==============================================================================
* Figure 4.8. Effect of IMF conditionality on government health spending per capita, with 95% and 90% confidence intervals
* ==============================================================================
xtset cid year
cmp setup
local ctrl "l.lngdppc l.urban l.dratio l.fhip l.war l.govbal l.trade l.oda i.cid ib2000.year"
local sele "\`ctrl' l.cab"
cmp (hlnrpop = LIMF55 l.BA2TOT `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2TOT = l.intBA2TOT `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
margins, at(l.BA2TOT=(0 10 20 30 40 50) LIMF55=1) vsquish level(95) saving(l95, replace)
margins, at(l.BA2TOT=(0 10 20 30 40 50) LIMF55=1) vsquish level(90) saving(l90, replace)
combomarginsplot l95 l90, recast(line) recastci(rarea) ytitle(Linear prediction: Gov. health exp. per capita (logged)) ylabel(, angle(horizontal)) xtitle(Number of binding conditions) title("") graphregion(color(white)) scheme(s2mono) legend(off)
graph export "Figures\IMFBOOK_Figure4-8.png", replace width(4000)
erase l95.dta
erase l90.dta
* ==============================================================================
* Figure 4.9. Effect of IMF conditionality policy areas on government health spending (% of GDP), with 95% and 90% confidence intervals
* ==============================================================================
xtset cid year
cmp setup
local ctrl "l.lngdppc l.urban l.dratio l.fhip l.war l.govbal l.trade l.oda i.cid ib2000.year"
local sele "\`ctrl' l.cab"
* DEB
eststo: cmp (hgdp = LIMF55 l.BA2DEB l.resBA2DEB `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2DEB = l.intBA2DEB `sele') (res: l.resBA2DEB = l.intresBA2DEB `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* FIN
eststo: cmp (hgdp = LIMF55 l.BA2FIN l.resBA2FIN `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2FIN = l.intBA2FIN `sele') (res: l.resBA2FIN = l.intresBA2FIN `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* RFP
eststo: cmp (hgdp = LIMF55 l.BA2RFP l.resBA2RFP `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2RFP = l.intBA2RFP `sele') (res: l.resBA2RFP = l.intresBA2RFP `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* EXT
eststo: cmp (hgdp = LIMF55 l.BA2EXT l.resBA2EXT `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2EXT = l.intBA2EXT `sele') (res: l.resBA2EXT = l.intresBA2EXT `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* ENT 	
eststo: cmp (hgdp = LIMF55 l.BA2ENT l.resBA2ENT `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2ENT = l.intBA2ENT `sele') (res: l.resBA2ENT = l.intresBA2ENT `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* LAB
eststo: cmp (hgdp = LIMF55 l.BA2LAB l.resBA2LAB `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2LAB = l.intBA2LAB `sele') (res: l.resBA2LAB = l.intresBA2LAB `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* GOV
eststo: cmp (hgdp = LIMF55 l.BA2GOV l.resBA2GOV `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2GOV = l.intBA2GOV `sele') (res: l.resBA2GOV = l.intresBA2GOV `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* POV
eststo: cmp (hgdp = LIMF55 l.BA2POV l.resBA2POV `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2POV = l.intBA2POV `sele') (res: l.resBA2POV = l.intresBA2POV `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
esttab, b(4) se(4) nogaps brackets star(+ 0.10 * 0.05 ** 0.01 *** 0.001) scalars(N_clust) sfmt(a4) drop(*cid *year)
estimates dir
estimates restore est1
test ([cond] l.intBA2DEB)
test ([res] l.intresBA2DEB)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2DEB) level(90)
estimates restore est2
test ([cond] l.intBA2FIN)
test ([res] l.intresBA2FIN)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2FIN) level(90)
estimates restore est3
test ([cond] l.intBA2RFP)
test ([res] l.intresBA2RFP)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2RFP) level(90)
estimates restore est4
test ([cond] l.intBA2EXT)
test ([res] l.intresBA2EXT)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2EXT) level(90)
estimates restore est5
test ([cond] l.intBA2ENT)
test ([res] l.intresBA2ENT)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2ENT) level(90)
estimates restore est6
test ([cond] l.intBA2LAB)
test ([res] l.intresBA2LAB)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2LAB) level(90)
estimates restore est7
test ([cond] l.intBA2GOV)
test ([res] l.intresBA2GOV)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2GOV) level(90)
estimates restore est8
test ([cond] l.intBA2POV)
test ([res] l.intresBA2POV)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2POV) level(90)
coefplot (est1, offset(0)) est2 est3 est4 est5 est6 est7 est8, keep(hgdp:L.BA2*) coeflabels(L.BA2DEB="External debt issues" L.BA2FIN=`""Financial, monetary" "& Central Bank"' L.BA2RFP=`""Fiscal issues," "revenues & taxation""' L.BA2EXT=`""External sector" "(trade & exchange)"' L.BA2ENT=`""SOE privatisation," "reform & pricing""' L.BA2LAB=`""Labour (public" "& private sector)""' L.BA2GOV="Institutional reforms" L.BA2POV="Poverty reduction") mcolor(black) ciopts(recast(. rcap) lcolor(black black)) xline(0, lcolor(black) lwidth(thin) lpattern(dash)) xtitle("Conditionality effect size") levels(95 90) nokey grid(within) graphregion(color(white))
graph export "Figures\IMFBOOK_Figure4-9.png", replace width(4000)
eststo clear
* ==============================================================================
* Figure 4.10. Effect of IMF conditionality policy areas on government health spending per capita, with 95% and 90% confidence intervals
* ==============================================================================
xtset cid year
cmp setup
local ctrl "l.lngdppc l.urban l.dratio l.fhip l.war l.govbal l.trade l.oda i.cid ib2000.year"
local sele "\`ctrl' l.cab"
* DEB
eststo: cmp (hlnrpop = LIMF55 l.BA2DEB l.resBA2DEB `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2DEB = l.intBA2DEB `sele') (res: l.resBA2DEB = l.intresBA2DEB `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* FIN
eststo: cmp (hlnrpop = LIMF55 l.BA2FIN l.resBA2FIN `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2FIN = l.intBA2FIN `sele') (res: l.resBA2FIN = l.intresBA2FIN `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* RFP
eststo: cmp (hlnrpop = LIMF55 l.BA2RFP l.resBA2RFP `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2RFP = l.intBA2RFP `sele') (res: l.resBA2RFP = l.intresBA2RFP `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* EXT
eststo: cmp (hlnrpop = LIMF55 l.BA2EXT l.resBA2EXT `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2EXT = l.intBA2EXT `sele') (res: l.resBA2EXT = l.intresBA2EXT `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* ENT 	
eststo: cmp (hlnrpop = LIMF55 l.BA2ENT l.resBA2ENT `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2ENT = l.intBA2ENT `sele') (res: l.resBA2ENT = l.intresBA2ENT `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* LAB
eststo: cmp (hlnrpop = LIMF55 l.BA2LAB l.resBA2LAB `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2LAB = l.intBA2LAB `sele') (res: l.resBA2LAB = l.intresBA2LAB `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* GOV
eststo: cmp (hlnrpop = LIMF55 l.BA2GOV l.resBA2GOV `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2GOV = l.intBA2GOV `sele') (res: l.resBA2GOV = l.intresBA2GOV `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* POV
eststo: cmp (hlnrpop = LIMF55 l.BA2POV l.resBA2POV `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2POV = l.intBA2POV `sele') (res: l.resBA2POV = l.intresBA2POV `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
esttab, b(4) se(4) nogaps brackets star(+ 0.10 * 0.05 ** 0.01 *** 0.001) scalars(N_clust) sfmt(a4) drop(*cid *year)
estimates dir
estimates restore est1
test ([cond] l.intBA2DEB)
test ([res] l.intresBA2DEB)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2DEB) level(90)
estimates restore est2
test ([cond] l.intBA2FIN)
test ([res] l.intresBA2FIN)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2FIN) level(90)
estimates restore est3
test ([cond] l.intBA2RFP)
test ([res] l.intresBA2RFP)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2RFP) level(90)
estimates restore est4
test ([cond] l.intBA2EXT)
test ([res] l.intresBA2EXT)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2EXT) level(90)
estimates restore est5
test ([cond] l.intBA2ENT)
test ([res] l.intresBA2ENT)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2ENT) level(90)
estimates restore est6
test ([cond] l.intBA2LAB)
test ([res] l.intresBA2LAB)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2LAB) level(90)
estimates restore est7
test ([cond] l.intBA2GOV)
test ([res] l.intresBA2GOV)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2GOV) level(90)
estimates restore est8
test ([cond] l.intBA2POV)
test ([res] l.intresBA2POV)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2POV) level(90)
coefplot (est1, offset(0)) est2 est3 est4 est5 est6 est7 est8, keep(hlnrpop:L.BA2*) coeflabels(L.BA2DEB="External debt issues" L.BA2FIN=`""Financial, monetary" "& Central Bank"' L.BA2RFP=`""Fiscal issues," "revenues & taxation""' L.BA2EXT=`""External sector" "(trade & exchange)"' L.BA2ENT=`""SOE privatisation," "reform & pricing""' L.BA2LAB=`""Labour (public" "& private sector)""' L.BA2GOV="Institutional reforms" L.BA2POV="Poverty reduction") mcolor(black) ciopts(recast(. rcap) lcolor(black black)) xline(0, lcolor(black) lwidth(thin) lpattern(dash)) xtitle("Conditionality effect size") levels(95 90) nokey grid(within) graphregion(color(white))
graph export "Figures\IMFBOOK_Figure4-10.png", replace width(4000)
eststo clear
* ==============================================================================
* Figure 4.11. Conditionality in West Africa, 1995–2017
* ==============================================================================
preserve
sort cname
encode cname, gen(cname2)
egen cname3 = rank(-cname2), by(year)
labmask cname3, val(cname)
replace BA1TOT=0 if missing(BA1TOT)
heatplot BA1TOT i.cname3 year if wafr==1 & year>=1995 & year<=2017, yscale(noline) ylabel(, nogrid) xlabel(1995(2)2017, angle(45) format(%ty) nogrid) color(white black) cuts(0 1 30 60 90) ramp(label(1 30 60 90) subtitle("Number of conditions", size(medium)) graphregion(color(white)) xlabel(, labsize(*1))) p(lcolor(gs6) lwidth(*0.05)) ytitle("") xtitle("", size(small)) discrete graphregion(color(white)) scheme(s1mono)
graph export "Figures\IMFBOOK_Figure4-11.png", replace width(4000)
restore
* ==============================================================================
* Supplementary statistical code. Additional tests for post-treatment bias 
* ==============================================================================
xtset cid year
cmp setup
local ctrl "l.lngdppc l.urban l.dratio l.fhip l.war l.trade l.oda i.cid ib2000.year"
local sele "\`ctrl' l.cab"
* RFP
eststo: cmp (hgdp = LIMF55 l.BA2RFP l.resBA2RFP `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2RFP = l.intBA2RFP `sele') (res: l.resBA2RFP = l.intresBA2RFP `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* RFP
eststo: cmp (hlnrpop = LIMF55 l.BA2RFP l.resBA2RFP `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2RFP = l.intBA2RFP `sele') (res: l.resBA2RFP = l.intresBA2RFP `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
estimates dir
estimates restore est1
test ([cond] l.intBA2RFP)
test ([res] l.intresBA2RFP)
test ([LIMF55] l.intIMF55)
estimates restore est2
test ([cond] l.intBA2RFP)
test ([res] l.intresBA2RFP)
test ([LIMF55] l.intIMF55)
eststo clear
* ==============================================================================
